#ifndef _UV_EFFECT_FUNCTIONS_
#define _UV_EFFECT_FUNCTIONS_

// Scoll the UV single Direction, Speed default is 1.0
float ScollSingleDirection(float UV, float speed) {
    float t = _Time.x - floor(_Time.x);
    float OUT = UV + (t * speed);
    return OUT;
}

// Scoll the UV two Direction, Speed default is 1.0 , if speed < 0, The scoll will reverse.
float2 ScollTwoDirection(float2 UV, float speed) {
    float2 OUT;
    OUT.x = ScollSingleDirection(UV.x, speed);
    OUT.y = ScollSingleDirection(UV.y, speed);
    return OUT;
}

float2 ScrollUV(float2 UV, float direction , float speed) {
    float2 OUT;
    float t = _Time.x - floor(_Time.x);
    float u = t * direction;
    float v = t * (1 - direction);
    float2 uv = float2(u, v);
    OUT = UV + uv * speed;
    return OUT;
}

// Using distrub flow map to noise flow Direction
float2 FlowUV(float2 uv, float2 flowVector, float speed, float time) {
    //float processTime = frac(time);
    return uv - flowVector * speed * time;
}




#endif